package com.example.demo.ai.llm.controller;

import com.example.demo.ai.llm.service.LlmService;
import com.jfinal.kit.Kv;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.noear.solon.annotation.*;

/**
 * @author airhead
 */
@Controller
@Mapping("/llm")
@Api("聊天")
public class LlmController {
  @Inject private LlmService service;

  @ApiOperation("flow")
  @Post
  @Mapping("flow")
  public Kv flow(String prompt) {
    return service.flow(prompt);
  }

  @ApiOperation("aiFlow")
  @Post
  @Mapping("aiFlow")
  public Kv aiFlow(String prompt) {
    return service.aiFlow(prompt);
  }
}
